package com.herenit.beijing.dh2011.entity;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.*;

@Entity
@Table(name = "ET_VERSIONS")
public class EtVersions implements Serializable {

	private static final long serialVersionUID = 1L;
	@TableGenerator(
			name = "idGenerator", 
			table = "ET_Id_Generator", 
			pkColumnName = "pkColumn",
			valueColumnName = "valueColumn",
			pkColumnValue = "Version_Id",
			allocationSize = 100,
			initialValue = 2300
			)
	@Id
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "idGenerator")
	private long id;

	@Column(name = "VERSION_NAME", nullable = false)
	private String versionName;

	@Column(name = "VERSION_DESC")
	private String versionDesc;

	@Column(name = "RETIRED_DATE")
	private Timestamp retiredDate;

	@Column(name = "STATUS_CODE", nullable = false)
	private String statusCode;

	@Column(name = "LOAD_DATE")
	private Timestamp loadDate;

	@Column(name = "DEFAULT_FLAG", nullable = false)
	private String defaultFlag;

	@Column(name = "HISTORY_TYPE_CODE")
	private String historyTypeCode;

	@Column(name = "CREATED_BY", nullable = false)
	private Long createdBy;

	@Column(name = "CREATED_BY_NAME", nullable = false)
	private String createdByName;

	@Column(name = "CREATION_DATE", nullable = false)
	private Timestamp creationDate;

	@Column(name = "LAST_UPDATED_BY", nullable = false)
	private Long lastUpdatedBy;

	@Column(name = "LAST_UPDATED_BY_NAME", nullable = false)
	private String lastUpdatedByName;

	@Column(name = "LAST_UPDATE_DATE", nullable = false)
	private Timestamp lastUpdateDate;

	@OneToMany(mappedBy = "etVersions",fetch=FetchType.LAZY)
	private List<EtConcepts> etConceptsList;

	@ManyToOne
	@JoinColumn(name = "CODINGSCHEME_ID")
	private EtCodingSchemes etCodingSchemes;

	public EtVersions() {
		Long i = new Long(1);
		Timestamp nowTime = new Timestamp(new Date().getTime());

		createdBy = i;
		creationDate = nowTime;
		lastUpdatedBy = i;
		lastUpdateDate = nowTime;

	}



	public long getId() {
		return id;
	}



	public void setId(long id) {
		this.id = id;
	}



	public String getVersionName() {
		return versionName;
	}

	public void setVersionName(String versionName) {
		this.versionName = versionName;
	}

	public String getVersionDesc() {
		return versionDesc;
	}

	public void setVersionDesc(String versionDesc) {
		this.versionDesc = versionDesc;
	}

	public Timestamp getRetiredDate() {
		return retiredDate;
	}

	public void setRetiredDate(Timestamp retiredDate) {
		this.retiredDate = retiredDate;
	}

	public String getStatusCode() {
		return statusCode;
	}

	public void setStatusCode(String statusCode) {
		this.statusCode = statusCode;
	}

	public Timestamp getLoadDate() {
		return loadDate;
	}

	public void setLoadDate(Timestamp loadDate) {
		this.loadDate = loadDate;
	}

	public String getDefaultFlag() {
		return defaultFlag;
	}

	public void setDefaultFlag(String defaultFlag) {
		this.defaultFlag = defaultFlag;
	}

	public String getHistoryTypeCode() {
		return historyTypeCode;
	}

	public void setHistoryTypeCode(String historyTypeCode) {
		this.historyTypeCode = historyTypeCode;
	}

	public Long getCreatedBy() {
		return createdBy;
	}

	public void setCreatedBy(Long createdBy) {
		this.createdBy = createdBy;
	}

	public String getCreatedByName() {
		return createdByName;
	}

	public void setCreatedByName(String createdByName) {
		this.createdByName = createdByName;
	}

	public Timestamp getCreationDate() {
		return creationDate;
	}

	public void setCreationDate(Timestamp creationDate) {
		this.creationDate = creationDate;
	}

	public Long getLastUpdatedBy() {
		return lastUpdatedBy;
	}

	public void setLastUpdatedBy(Long lastUpdatedBy) {
		this.lastUpdatedBy = lastUpdatedBy;
	}

	public String getLastUpdatedByName() {
		return lastUpdatedByName;
	}

	public void setLastUpdatedByName(String lastUpdatedByName) {
		this.lastUpdatedByName = lastUpdatedByName;
	}

	public Timestamp getLastUpdateDate() {
		return lastUpdateDate;
	}

	public void setLastUpdateDate(Timestamp lastUpdateDate) {
		this.lastUpdateDate = lastUpdateDate;
	}

	public List<EtConcepts> getEtConceptsList() {
		return etConceptsList;
	}

	public void setEtConceptsList(List<EtConcepts> etConceptsList) {
		this.etConceptsList = etConceptsList;
	}

	public EtCodingSchemes getEtCodingSchemes() {
		return etCodingSchemes;
	}

	public void setEtCodingSchemes(EtCodingSchemes etCodingSchemes) {
		this.etCodingSchemes = etCodingSchemes;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

}
